<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<h:head>
	<title>Fiche d'un film</title>
	<link rel="stylesheet" type="text/css" href="style.css" />

	<f:metadata>
		<f:viewParam name="id" value="#{beanFilm.idCourant}" required="true"
			requiredMessage="inconnu" />
	</f:metadata>
</h:head>

<h:body>

	<div id="header">
		<ui:include src="header.xhtml" />
	</div>

	<div class="bobine minH"></div>
	<div id="contenu" class="minH">
		<h:panelGrid styleClass="form inscription"
			rendered="#{beanUtilisateur.isLoggedIn() == false}">
			<ui:include src="demandeConnexion.xhtml" />
		</h:panelGrid>


		<h:panelGroup rendered="#{beanUtilisateur.isLoggedIn() == true}">
			<div class="imgProfil">
				<img src="#{beanFilm.film.image}" width="200" />
			</div>
			<div class="infoGenerales">

				<h1>
					<h:outputLabel value="#{beanFilm.film.titre}" />
				</h1>
				<br /> <br />
				<h:outputLabel value="#{nomColonnes['label.date_f']}" />
				<h:outputLabel value="#{beanFilm.film.annee}">
				</h:outputLabel>
				<br />
				<h:outputLabel value="#{nomColonnes['label.cout_f']}" />
				<h:outputLabel value="#{beanFilm.film.cout}$" />
				<br />

			</div>

			<div class="divTable">
				<h2>Recompenses :</h2>
				<h:dataTable value="#{beanFilm.film.listeRecompenses}"
					var="recompense" class="table">
					<h:column>
						<h:outputText value="#{recompense.annee}" />
					</h:column>
					<h:column>
						<h:outputText value="#{recompense.raison}" />
					</h:column>
					<h:column>
						<h:outputText value="#{recompense.type}" />
					</h:column>


				</h:dataTable>
			</div>

			<div class="divTable">
				<h2>Producteurs :</h2>
				<h:dataTable value="#{beanFilm.film.listeProducteurs}"
					var="personne" title="Producteur" class="table">
					<h:column>
						<h:outputLink value="fichePersonne.xhtml">
							<f:param name="id" value="#{personne.id}" />
							<h:outputText value="#{personne.prenom} #{personne.nom}" />
						</h:outputLink>
					</h:column>
				</h:dataTable>
			</div>


			<div class="divTable">
				<h2>Réalisateurs :</h2>
				<h:dataTable value="#{beanFilm.film.listeRealisateurs}"
					var="personne" title="RÃ©alisateur" class="table">
					<h:column>
						<h:outputLink value="fichePersonne.xhtml">
							<f:param name="id" value="#{personne.id}" />
							<h:outputText value="#{personne.prenom} #{personne.nom}" />
						</h:outputLink>
					</h:column>
				</h:dataTable>
			</div>

			<div class="divTable">
				<h2>Acteurs :</h2>
				<h:dataTable value="#{beanFilm.film.listeActeurs}" var="personne"
					title="Acteur" class="table">
					<h:column>
						<h:outputLink value="fichePersonne.xhtml">
							<f:param name="id" value="#{personne.id}" />
							<h:outputText value="#{personne.prenom} #{personne.nom}" />
						</h:outputLink>
					</h:column>
				</h:dataTable>
			</div>
			<br/>
			<h:outputLink value="ficheFilmModif.xhtml"
				rendered="#{beanUtilisateur.isLoggedIn()}">
				<f:param name="idFilmModif" value="#{beanFilm.film.id}" />
				<h:outputText value="#{nomColonnes['label.modif']}   " />
			</h:outputLink>
			<br />
			<h:outputLink value="AjoutActeurFilm.xhtml"
				rendered="#{beanUtilisateur.isLoggedIn()}">
				<f:param name="idFilmAjout" value="#{beanFilm.film.id}" />
				<h:outputText value="#{nomColonnes['label.ajout_A']}   " />
			</h:outputLink>
			<br/>
			<br/>
			
		</h:panelGroup>
	</div>
	<div class="bobine minH" />
	<div id="footer">Projet réalisé par Aurore Lambin et Pauline
		Fischer</div>
</h:body>

</html>